/**
* Title: Marvelous Mazes
* URL: http://online-judge.uva.es/p/v4/445.html
* Resources of interest:
* Solver group: David
* Contact e-mail: dncampo at gmail dot com
* Description of solution:
+ Ad-Hoc problem. Simular el proceso de creación del laberinto.

**/

#include <iostream>
#include <cstdlib>

using namespace std;

int main () {

	string line;
	while (getline (cin, line)) {
		if (1 == line.size ()) //new maze
			line = "";

		unsigned rep = 0;
		for (unsigned i = 0; i < line.size (); i++) {
			if (isdigit (line[i])) {
				char c[2];
				c[0] = line[i];
				c[1] = '\0';
				rep += atoi (c);
			}
			else if ('!' == line[i]) cout << endl; 
			else {
				if ('b' == line[i])	cout << string(rep, ' ');
				else cout << string(rep, line[i]);
				rep = 0;
			}
		}
		cout << endl;
	}

	return 0;
}
